Defect detection systems find defects in an image of an object to be inspected, denoted O in the present specification, such as a reticle, wafer, PCB or other patterned object. The patterned object is typically formed in accordance with a digital precursor thereof. Defects in the image are found by comparing the image, denoted I in the present specification, of the object O, to another, reference image, denoted R, DB or "database" in the present specification. The reference image R is sometimes modified, as by translation, scaling and/or rotation, prior to the defect detection process to bring it into accordance with the image I. Alternatively or in addition, the image I may be modified prior to defect detection to bring I into accord with R. Scaling and rotation transformations are typically applied to the image R.
Typically, discrepancies between the image I and the reference image R have more than one origin. Possible origins of discrepancies between the I and R images include the following:
a. Inaccuracies of the apparatus employed to generate the object O to be inspected from its digital precursor. PA1 b. Inaccuracies of the imaging apparatus employed to generate the image I from the object O, such as mechanical vibrations and optical distortions. PA1 c. Inaccuracies in generating the reference image R from a precursor thereof, such as rounding errors. PA1 d. Differences of scale, offset or orientation between image I and reference image R. PA1 e. Defects in the object O. PA1 summing differences in corresponding 2.times.2 pixel windows in image I and in transformed reference image R; and PA1 applying thresholds to the sums. PA1 taking the maximum over all the image location difference values; and PA1 applying the threshold to the maximum in order to obtain a single boolean difference measure for the comparison entity. PA1 for each individual translation from among a plurality of translations from the first digital representation to the second digital representation: PA1 announcing a defect for the comparison entity if none of the plurality of translations are legitimate therefor. PA1 summing the comparison entity legitimacy values of each individual translation from among the plurality of translations, over a plurality of adjacent comparison entities, and PA1 selecting at least one translation with a relatively high sum of comparison entity legitimacy values. PA1 for each individual translation from among a plurality of translations from the first digital representation to the second digital representation: PA1 announcing a defect for the comparison entity if none of the translations thereof are legitimate. PA1 comparing each individual one of a multiplicity of comparison entities of a first type in the first digital representation to at least one corresponding location in the second digital representation, the correspondences between the individual comparison entity of the first type and the at least one locations in the second digital representation respectively defining at least one transformations from the first digital representation to the second digital representation, PA1 comparing each individual one of a multiplicity of comparison entities of a second type in the first digital representation to at least one corresponding location in the second digital representation, the at least one locations in the second digital representation corresponding respectively to the at least one transformations applied to the individual comparison entity of the second type, and PA1 providing an output indication of differences between the first and second digital representations in accordance with the results of the comparing steps, PA1 wherein the two comparing steps are performed in parallel. PA1 I. for each individual translation from among a plurality of translations from the first digital representation to the second digital representation: PA1 II. announcing a defect for the comparison entity if none of the translations thereof are legitimate. PA1 for each individual location from among a multiplicity of locations within the first digital representation, determining at least one best translation from the first digital representation to the second digital representation for translating the individual location, and PA1 announcing an alignment error if the at least one best translations of a plurality of adjacent locations are mutually discrepant. PA1 A. for each individual translation from among a plurality of translations from the first digital representation to the second digital representation: PA1 B. improving the alignment of the first and second digital representations by operating an individual translation on the individual large location, wherein the individual translation is selected from the plurality of translations on the basis of the success score of the individual translation for the individual large location. PA1 a per-image location translation legitimacy determining unit operative to generate, for each individual translation from among a plurality of translations from the first digital representation to the second digital representation and for each individual image location from among a plurality of image locations within a comparison entity within the first digital representation, a binary legitimacy value of the individual translation for the individual image location, PA1 a per-comparison entity translation legitimacy determining unit operative to combine the binary legitimacy values of image locations within the comparison entity, thereby to generate a comparison entity legitimacy value determining whether the individual translation is legitimate for the comparison entity, and PA1 a defective comparison entity announcing unit operative to announce a defect for the comparison entity if none of the plurality of translations are legitimate therefor. PA1 a per-image location translation legitimacy determining unit operative, for each individual translation from among a plurality of translations from the first digital representation to the second digital representation and for each individual image location from among a plurality of image locations within a comparison entity within the first digital representation, to determine legitimacy of the individual translation for the individual image location by comparing the individual image location to a location in the second digital representation defined by operating the individual translation on the individual image location, PA1 a non-linear legitimacy combining unit operative to generate a nonlinear combination of the legitimacies of all image locations within the comparison entity, thereby defining the legitimacy of the individual translation for the comparison entity, and PA1 a defective comparison entity announcing unit operative to announce a defect for the comparison entity if none of the translations thereof are legitimate. PA1 first-type comparison entity comparing apparatus operative to compare each individual one of a multiplicity of comparison entities of a first type in the first digital representation to at least one corresponding location in the second digital representation, the correspondences between the individual comparison entity of the first type and the at least one locations in the second digital representation respectively defining at least one transformations from the first digital representation to the second digital representation, PA1 second-type comparison entity comparing apparatus operative to compare each individual one of a multiplicity of comparison entities of a second type in the first digital representation to at least one corresponding location in the second digital representation, the at least one locations in the second digital representation corresponding respectively to the at least one transformations applied to the individual comparison entity of the second type, and PA1 a difference announcer operative to provide an output indication of differences between the first and second digital representations in accordance with output received from the comparing apparatus, wherein the two comparing apparatus operate in parallel. PA1 wherein, for each individual translation from among a plurality of translations from the first digital representation to the second digital representation and for each individual image location from among a plurality of image locations within a comparison entity within the first digital representation: PA1 a per-image location translation legitimacy determining unit operative to determine the legitimacy of an individual translation for an individual image location in accordance with the outputs of the image location comparison unit and of the geometrical complexity evaluator for the individual translation and for the individual image location, PA1 a per-comparison entity translation legitimacy determining unit operative to combine the legitimacies of all image locations within an individual comparison entity, thereby defiling the legitimacy of the individual translation for the comparison entity, and PA1 a defective comparison entity announcer operative to announce a defect for the comparison entity if none of the translations thereof are legitimate. PA1 a per-large location success score generator operative to generate a success score for each individual translation from among a plurality of translations from the first digital representation to the second digital representation, the success score representing the success of the individual translation in translating the individual large location, the success score generator including: PA1 an alignment unit operative to improve the alignment of the first and second digital representations by operating an individual translation on an individual large location, wherein the individual translation is selected from the plurality of translations on the basis of the success score of the individual translation for the individual large location.
It is often very difficult to differentiate between discrepancies between the I and R images which are the result of defects in the object O, and discrepancies between the I and R images which have other origins, as detailed in (a)-(d) above. A discrepancy of the second type is also termed herein an "expected difference". In other words, an expected difference is a discrepancy between I and R which falls into one of categories (a) to (d) above. One type of expected difference between I and R images is an expected translation error. An expected translation error occurs when corresponding portions of the I and R images "drift".
State of the art approaches to defect detection may be classified as either "compensate and compare" approaches or "features" approaches. The word "compensate" is intended to refer to a characteristic of "compensate and compare" approaches whereby expected differences between compared objects are anticipated or allowed for and are not considered defects. The two approaches may be employed separately or in combination. The two approaches are now described.